package com.yunchao.feature.base.data

import com.tencent.mmkv.MMKV

object CacheManager {

    // 获取默认的 MMKV 实例
    private val mmkv: MMKV by lazy { MMKV.defaultMMKV() }

    fun putString(key: String, value: String): Boolean = mmkv.encode(key, value)

    fun getString(key: String, value: String = ""): String? = mmkv.decodeString(key, value)

    fun remove(key: String) = mmkv.removeValueForKey(key)

    fun clear() = mmkv.clearAll()
}